Nine-patch layer is used for showing framed images and buttons that change in size, because it scales the frame to match the size of the layer. Nine-patch layer scales images in the layer in a controlled way, instead of scaling them as one unit.
Nine-patch layer places nine images in a 3x3 grid. The images on the edges form the frame, while the center image holds the content of the nine-patch layer.
When you create nine-patch layers, keep the following in mind:
To create a nine-patch layer:
| Wrap Mode property value | Texture Stretch property value | Description |
|---|---|---|
| Clamp | Stretch | Default value. Scale the texture to fill the space between the corner textures of the nine-patch layer. |
| Clamp | Wrap | Extend the last column or row of pixels of the selected texture when the width or height of the space between the corner textures of the nine-patch layer exceed the width or height of the selected texture. |
| Repeat | Stretch | Scale the texture to fill the space between the corner textures of the nine-patch layer. |
| Repeat | Wrap | Tile the texture when the width or height of the space between the corner textures of the nine-patch layer exceed the width or height of the selected texture. |